#ifndef CLIENT_H
#define CLIENT_H
#include <QTcpSocket>
#include <QTimer>

class Client : public QTcpSocket
{
    Q_OBJECT
public:
    Client(QObject *parent = nullptr);
    void Set_server_info(QString ip);
    uint8_t Connect_server(void);
    // 原始数据做base64转码发送
    void SendData(QByteArray data);

private:
    QString Server_ip;
    quint16 Server_port = 0;

signals:
    void RecvSignal(QByteArray data);
    void ConnectedSignal(QTcpSocket *ServerSocket);
    void DisconnectedSignal(QTcpSocket *ServerSocket);
private slots:
    // 当有数据来时的槽函数
    void ReadyReadData_cb();
    void Connect_cb(void);
    void Disconnect_cb(void);
};

#endif // CLIENT_H
